/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.wms.studio.covert;

import org.springframework.stereotype.Component;

import com.wms.studio.api.dto.user.CreditDto;
import com.wms.studio.entity.Credit;
import com.wms.studio.exception.VerificationException;

/**
 * @author WMS
 * 
 */
@Component("creditCovert")
public class CreditCovert extends AbstractCovert<Credit, CreditDto> {

	@Override
	public CreditDto covertToDto(Credit e) {

		if (e == null) {
			return null;
		}

		CreditDto dto = new CreditDto();
		dto.setChangeTime(e.getChangeTime());
		dto.setCreditNum(e.getCreditNum());
		dto.setCreditType(e.getCreditType());
		dto.setDescriptions(e.getDescriptions());

		return dto;
	}

	@Override
	public Credit covertToEntity(CreditDto d) throws VerificationException {

		throw new VerificationException("不支持此方法");
	}

}
